<?php /* Smarty version 2.6.26, created on 2013-04-05 15:50:24
         compiled from mpattern_form.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'mpattern_form.html', 90, false),array('modifier', 'escape', 'mpattern_form.html', 109, false),array('function', 'html_radios', 'mpattern_form.html', 115, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		
		
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>

		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.btn_regist').click(function(){
				if( confirm('登録してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			
			$('.btn_update').click(function(){
				if( confirm('更新してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			
			$('.btn_return').click(function(){
				location.href = "mpattern_index.php?hist=2";
			});
			
			$('.media_flg').change(function(){
				if (this.value == 2) {
					$('#fm [name=block_cd]').val("");
					//$('.tr_price')['show']();
					$('#tr_block')['hide']();
				}
					else if (this.value == 3) {
					$('#fm [name=block_cd]').val("");
					//$('.tr_price')['show']();
					$('#tr_block')['hide']();
				} else {
					//$('.tr_price')['hide']();
					$('#tr_block')['show']();
				}
			});
		});
		</script>
		
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>パターンマスター管理</h2>
			<ul class="submenu clearfix">
				<li><a href="mpattern_index.php">パターン情報一覧</a></li>
				<li>パターン情報登録</li>
				<!--<li><a href="mpattern_import.php">CSV更新</a></li>-->
			</ul>
			<h3>パターン情報<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?><?php if ($this->_tpl_vars['phase'] == 'complete'): ?>完了<?php endif; ?></h3>
<?php if ($this->_tpl_vars['phase'] == 'input'): ?>
			<p class="message">内容を確認し、<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?>ボタンをクリックしてください。</p>
			<form name="fm" action="mpattern_form.php" method="post">
				<table class="formTable">
					<tbody>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
						<tr>
							<th>更新日</th>
							<td>
								<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['u_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y/%m/%d %H:%M") : smarty_modifier_date_format($_tmp, "%Y/%m/%d %H:%M")); ?>
<input type="hidden" name="u_time" value="<?php echo $this->_tpl_vars['forms']['u_time']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>更新者</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
<input type="hidden" name="m_user_name" value="<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>ID</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['id']; ?>

							</td>
						</tr>
<?php endif; ?>
						<tr>
							<th>※パターン名</th>
							<td>
								<input type="text" name="pattern_name" class="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['pattern_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100" /><?php echo $this->_tpl_vars['err']['pattern_name']; ?>

							</td>
						</tr>
						<tr>
							<th>※媒体</th>
							<td>
<?php echo smarty_function_html_radios(array('class' => 'media_flg','name' => 'media_flg','options' => $this->_tpl_vars['flags'],'selected' => $this->_tpl_vars['forms']['media_flg'],'separator' => '&nbsp;'), $this);?>
<?php echo $this->_tpl_vars['err']['media_flg']; ?>

							</td>
							</tr>
	<!--  <tr class = "tr_price" style="display: <?php if ($this->_tpl_vars['forms']['media_flg'] == 1 || $this->_tpl_vars['forms']['media_flg'] == 4 || $this->_tpl_vars['forms']['media_flg'] == 5): ?>none<?php else: ?>block<?php endif; ?>;">-->
	<tr class = "tr_price" style="display:none">
		<th>地域単価B2</th><td>
	<input type="text" name="priceb2" class="text" value="<?php echo $this->_tpl_vars['forms']['priceb2']; ?>
"   /><?php echo $this->_tpl_vars['err']['priceb2']; ?>

	</td>
	</tr>
	<tr class = "tr_price" style="display:none">
		<th>地域単価B3</th><td>
	<input type="text" name="priceb3" class="text" value="<?php echo $this->_tpl_vars['forms']['priceb3']; ?>
"   /><?php echo $this->_tpl_vars['err']['priceb3']; ?>

	</td>
	</tr>
	<tr class = "tr_price" style="display:none">
		<th>地域単価B4</th><td>
	<input type="text" name="priceb4" class="text" value="<?php echo $this->_tpl_vars['forms']['priceb4']; ?>
"   /><?php echo $this->_tpl_vars['err']['priceb2']; ?>

	</td>
	</tr>
	<tr id = "tr_block" style="display: <?php if ($this->_tpl_vars['forms']['media_flg'] == 2 || $this->_tpl_vars['forms']['media_flg'] == 3): ?>none<?php else: ?>block<?php endif; ?>;">
							<th>地域ブロック</th>
							<td>
<?php echo $this->_tpl_vars['err']['bid']; ?>

<table  style="width:100%;" rules="none"  frame=void ><tr>
<?php $_from = $this->_tpl_vars['block']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
	<td style="border-width:0 0 0 0;"> <label><input  name="bid[]" type="checkbox" class="cp" value="<?php echo $this->_tpl_vars['v']['block_cd']; ?>
" <?php if ($this->_tpl_vars['v']['pchk']): ?>checked<?php endif; ?> /> <?php echo $this->_tpl_vars['v']['block_name']; ?>
</label>
	<input type="hidden" name="block_cd[]" value="<?php echo $this->_tpl_vars['v']['block_cd']; ?>
" /><input type="hidden" name="block_name[]" value="<?php echo $this->_tpl_vars['v']['block_name']; ?>
" />
	</td>
	<?php if (($this->_foreach['member']['iteration']-1) % 4 == 3): ?></tr><tr><?php endif; ?>
<?php endforeach; endif; unset($_from); ?>


</table>
							</td>
						</tr>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
						<tr>
							<th>非表示設定</th>
							<td style = "vertical-align:middle">
								<label><input class="chkinput" type="checkbox" name="disp_ng" value="1" <?php if ($this->_tpl_vars['forms']['disp_ng'] == '1'): ?> checked  <?php endif; ?>/> 非表示にする</label>
							</td>
						</tr>
<?php endif; ?>
					</tbody>
				</table>
				<p class="button">
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
					<button type="button" class="btn_return" class="submit"><span>戻る</span></button>
					<button type="button" class="btn_update" class="submit"><span>更新</span></button>
<?php else: ?>
					<button type="button" class="btn_regist" class="submit"><span>登録</span></button>
<?php endif; ?>
				</p>
				<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['forms']['id']; ?>
" />
				<input type="hidden" name="mode" value="" />
			</form>

<div id="dialog" >
</div>
 
<?php endif; ?>

<?php if ($this->_tpl_vars['phase'] == 'complete'): ?>
			<p class="message"><?php echo $this->_tpl_vars['message']; ?>
</p>
			<ul>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="mpattern_index.php?hist=2">一覧ページに戻る</a></li>
<?php else: ?>
				<li>>> <a href="mpattern_index.php">一覧ページに戻る</a></li>
<?php endif; ?>
				<li>>> <a href="mpattern_form.php">新規登録</a></li>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="mpattern_form.php?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
">更新</a></li>
<?php endif; ?>
			</ul>
<?php endif; ?>

		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>